<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>no_exceptions_support</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Chapter 1. Boost.Core">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Core">
<link rel="prev" href="lightweight_test.html" title="lightweight_test">
<link rel="next" href="noinit_adaptor.html" title="noinit_adaptor">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="lightweight_test.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="noinit_adaptor.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="core.no_exceptions_support"></a><a class="link" href="no_exceptions_support.html" title="no_exceptions_support">no_exceptions_support</a>
</h2></div></div></div>
<div class="toc"><dl class="toc"><dt><span class="section"><a href="no_exceptions_support.html#core.no_exceptions_support.header_boost_core_no_exceptions_">Header
      &lt;boost/core/no_exceptions_support.hpp&gt;</a></span></dt></dl></div>
<div class="simplesect">
<div class="titlepage"><div><div><h3 class="title">
<a name="idm8479"></a>Authors</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
          Pavel Vozenilek
        </li></ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="core.no_exceptions_support.header_boost_core_no_exceptions_"></a><a class="link" href="no_exceptions_support.html#core.no_exceptions_support.header_boost_core_no_exceptions_" title="Header &lt;boost/core/no_exceptions_support.hpp&gt;">Header
      &lt;boost/core/no_exceptions_support.hpp&gt;</a>
</h3></div></div></div>
<p>
        The header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">core</span><span class="special">/</span><span class="identifier">no_exceptions_support</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
        defines macros for use in code that needs to be portable to environments
        that do not have support for C++ exceptions.
      </p>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="core.no_exceptions_support.header_boost_core_no_exceptions_.synopsis"></a><a class="link" href="no_exceptions_support.html#core.no_exceptions_support.header_boost_core_no_exceptions_.synopsis" title="Synopsis">Synopsis</a>
</h4></div></div></div>
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_TRY</span> <span class="comment">/*unspecified*/</span>
<span class="preprocessor">#define</span> <span class="identifier">BOOST_CATCH</span><span class="special">(</span><span class="identifier">x</span><span class="special">)</span> <span class="comment">/*unspecified*/</span>
<span class="preprocessor">#define</span> <span class="identifier">BOOST_CATCH_END</span> <span class="comment">/*unspecified*/</span>
<span class="preprocessor">#define</span> <span class="identifier">BOOST_RETHROW</span> <span class="comment">/*unspecified*/</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="core.no_exceptions_support.header_boost_core_no_exceptions_.example_use"></a><a class="link" href="no_exceptions_support.html#core.no_exceptions_support.header_boost_core_no_exceptions_.example_use" title="Example Use">Example
        Use</a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">foo</span><span class="special">()</span> <span class="special">{</span>
  <span class="identifier">BOOST_TRY</span> <span class="special">{</span>
    <span class="special">...</span>
  <span class="special">}</span> <span class="identifier">BOOST_CATCH</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span><span class="special">&amp;)</span> <span class="special">{</span>
      <span class="special">...</span>
      <span class="identifier">BOOST_RETHROW</span>
  <span class="special">}</span> <span class="identifier">BOOST_CATCH</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">exception</span><span class="special">&amp;</span> <span class="identifier">e</span><span class="special">)</span> <span class="special">{</span>
      <span class="special">...</span>
  <span class="special">}</span>
  <span class="identifier">BOOST_CATCH_END</span>
<span class="special">}</span>
</pre>
<p>
          With exception support enabled it will expand into:
        </p>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">foo</span><span class="special">()</span> <span class="special">{</span>
  <span class="special">{</span> <span class="keyword">try</span> <span class="special">{</span>
    <span class="special">...</span>
  <span class="special">}</span> <span class="keyword">catch</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span><span class="special">&amp;)</span> <span class="special">{</span>
      <span class="special">...</span>
      <span class="keyword">throw</span><span class="special">;</span>
  <span class="special">}</span> <span class="keyword">catch</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">exception</span><span class="special">&amp;</span> <span class="identifier">e</span><span class="special">)</span> <span class="special">{</span>
      <span class="special">...</span>
  <span class="special">}</span>
  <span class="special">}</span>
<span class="special">}</span>
</pre>
<p>
          With exception support disabled it will expand into:
        </p>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">foo</span><span class="special">()</span> <span class="special">{</span>
  <span class="special">{</span> <span class="keyword">if</span><span class="special">(</span><span class="keyword">true</span><span class="special">)</span> <span class="special">{</span>
    <span class="special">...</span>
  <span class="special">}</span> <span class="keyword">else</span> <span class="keyword">if</span> <span class="special">(</span><span class="keyword">false</span><span class="special">)</span> <span class="special">{</span>
      <span class="special">...</span>
  <span class="special">}</span> <span class="keyword">else</span> <span class="keyword">if</span> <span class="special">(</span><span class="keyword">false</span><span class="special">)</span>  <span class="special">{</span>
      <span class="special">...</span>
  <span class="special">}</span>
  <span class="special">}</span>
<span class="special">}</span>
</pre>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2014 Peter Dimov<br>Copyright © 2014 Glen Fernandes<br>Copyright © 2014 Andrey Semashev<p>
        Distributed under the <a href="http://boost.org/LICENSE_1_0.txt" target="_top">Boost
        Software License, Version 1.0</a>.
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="lightweight_test.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="noinit_adaptor.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
